package main

import (
	_ "github.com/lib/pq"
	"github.com/astaxie/beego"
	//"github.com/astaxie/beego/logs"
	_ "yikexing.com.cn/wyws/docs"
	_ "yikexing.com.cn/wyws/routers"
	_ "yikexing.com.cn/wyws/filter"
	_ "yikexing.com.cn/wyws/services/user"

	"yikexing.com.cn/wyws/controllers"

)

func initLog() {
	beego.SetLogger("file", `{"filename":"logs/spare-repo.log", "daily":true, "maxdays":10}`)
	beego.SetLogFuncCall(true)
	beego.SetLevel(beego.LevelDebug)
}

func main() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"


		//logs.SetLogger(logs.AdapterFile,`{"filename":"logs/project.log","level":7,"maxlines":500,"maxsize":0,"daily":true,"maxdays":10}`)

	}
	initLog()
	beego.ErrorController(&controllers.ErrorController{})
	beego.Run()

}

